package com.itc.display;

import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Image;

public class AlertDialog {
	public Alert createSetupAlert(String imageName, String title,
			String message, AlertType alertType) {
		Image image = null;
		if (imageName != null) {
			try {
				// load the image for the image from file
				image = Image.createImage(imageName);
			} catch (Exception ex) {
			}
		}
		Alert alert = new Alert(title, message, image, alertType);
		if (alertType == AlertType.CONFIRMATION) {
			alert.setTimeout(Alert.FOREVER);
		} else {
			// ...else Alert will stay at the top for 4 seconds
			alert.setTimeout(4000);
		}
		return alert;
	}
}
